package day03.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * @ClassName OISDemo
 * @Description TODO
 * @Author xinghaiyang
 * @Date 2023/3/19 16:49
 * @Version 1.0
 *
 * 使用对象输入流进行反序列化
 **/
public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("./person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);
        Person p = (Person) ois.readObject();
        System.out.println(p);
        ois.close();
    }
}
